package com.bw.ivideoproject.video

import com.bw.ivideoproject.entity.BaseResp
import com.bw.ivideoproject.entity.TypeEntity
import com.bw.ivideoproject.entity.VideoEntity
import com.bw.lib_mvvm.BaseModel
import retrofit2.http.Query

class VideoModel : BaseModel() {

    private val api:VideoApi by lazy {
        getVideoService(VideoApi::class.java)
    }

    suspend fun getType():BaseResp<List<TypeEntity>>{
        return api.getType()
    }

    suspend fun getTypeById(pid:Int):BaseResp<List<TypeEntity>>{
        return api.getTypeById(pid)
    }

    suspend fun getVideoByType(typeId:Int,page:Int,pageSize:Int):BaseResp<List<VideoEntity>>{
        return api.getVideoByType(typeId,page,pageSize)
    }

}